package com.platform.tony.config;


import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.*;

/**
 * https://zhuanlan.zhihu.com/p/643593095
 */


@Slf4j
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {


    // 拦截器配置
    @Override
    public void addInterceptors(InterceptorRegistry registry) {

    }

    // 视图跳转控制器
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {

//        registry.addViewController("/login").setViewName("login");
//        registry.addViewController("/home").setViewName("home");
//        registry.addViewController("/").setViewName("home");

    }

    // 静态资源处理器
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {

    }

    // 这里配置视图解析器
    @Override
    public void configureViewResolvers(ViewResolverRegistry registry) {
    }

    // 解决跨域问题
    @Override
    public void addCorsMappings(CorsRegistry registry) {



    }
}
